home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Events / EventQueue.h < prev    next >
Text File  |  1997-06-28  |  957b  |  49 lines

  1. // EventQueue.h
  2.  
  3. #ifndef EventQueue_h
  4. #define EventQueue_h
  5.  
  6. #ifndef Integers_h
  7. #include "Integers.h"
  8. #endif
  9. #ifndef EventManagerUser_h
  10. #include "EventManagerUser.h"
  11. #endif
  12. #ifndef Assert_h
  13. #include "Assert.h"
  14. #endif
  15. #ifndef FiniteQueue_h
  16. #include "FiniteQueue.h"
  17. #endif
  18.  
  19. class EventQueue: public EventManagerUser
  20.   {
  21.     private:
  22.         FiniteQueue< EventRecord, 2 > events;
  23.         EventRecord *previous;
  24.         EventRecord *current;
  25.         EventRecord *next;
  26.         
  27.         EventQueue();
  28.         
  29.         static bool Valid( const EventRecord& );
  30.         static bool Exists( WindowPeek );
  31.         
  32.         void Advance();
  33.         
  34.     public:
  35.         static EventQueue& The();
  36.         
  37.         const EventRecord& operator*() const    { Assert( current != 0 ); return *current; }
  38.         const EventRecord *operator->() const    { Assert( current != 0 ); return current; }
  39.         
  40.         void operator++();
  41.         void operator++(int)                            { operator++(); }
  42.         void AdvanceWithoutWaiting();
  43.         
  44.         void operator--();
  45.         void operator--(int)                            { operator--(); }
  46.   };
  47.  
  48. #endif
  49.